          
          
         
            //var originalWidth = consultWidth = window.innerWidth;
            //var linkJumpCount = 16;
            var linkHref;
            var beginningDelay = 0;
            var animateDelayCount = 1000;
            var watchBrowse = null;

            //first ele add class
            function fstAddClass(){
                for(var c = 0;c < $('.addFst').length;c++){
                    $('.addFst:eq(' + c + ')>*:first-child').addClass('active');
                }
            }
            
            function countDown(){
                    linkJumpCount -= 1;
                
                    //linkJumpCount=0时，跳转页面
                    if(linkJumpCount <= 0){
                        location.href = linkHref;
                    }

                    //每秒执行一次,showTime()
                    setTimeout("countDown()",100);
            }
            /*
            //页面内容高度小于窗口高度
            function checkContnHeight(){
                if($('.container')[0].offsetHeight < window.innerHeight){
                    $('.container').addClass('fillAll');
                }
            }
            */
            
            
            //前进后退页面处于顶部
            function beginningAtTop(){
                setTimeout(function(){
                    document.documentElement.scrollTop = document.body.scrollTop = 0;
                },10)
            }

            //返回顶部
            var toTop = null;
            function windowToTop(){
                clearInterval(toTop);
                toTop = setInterval(function(){
                    var current = document.documentElement.scrollTop || document.body.scrollTop;
                    var val = Math.ceil(current / 10);
                    var newScroll = current - val;
                    if(newScroll <= 0){
                        document.documentElement.scrollTop = document.body.scrollTop = 0;
                        clearInterval(toTop);
                        toTop = null
                    }else{
                        document.documentElement.scrollTop = document.body.scrollTop = newScroll;
                    }
                    
                    
                },10);
                
            }

            //滑动至指定部分
          
            function scrollSec(val){
                scrollDown = scrollStart = true;
                jumpPoint = val;
                scrlTimes = jumpPoint / 100;
                custmzScroll();
            }


            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    $('body').removeClass('pc');
                    return true;
                }else{
                    return false;
                }
            }

            var ctctLft = null;
            var currLft = 0;
            var lftGt;
            var scrlTimes = 0;
            
            
            var watchWindowWidth = null;
            var scrollOld,scrollNew;
            var scrollDown = '';
            var scrollStart = false;
            var scrollIntvl = null;
            var scrollStep = 15;
            var barOpacity = null;
            var watchScrollTop = null;
            var consultScroll;
            var mobileWatchingTop = null;
            var bodyH,canScroll;
            var scrlTimes;
            var jumpPoint = 0;
            var watchSide = null;

            //禁止滚动
            window.addEventListener('DOMMouseScroll', function (e) {
                if(!$('.mobileDevice').length && (window.location.href.indexOf('about.html') < 0 || (window.location.href.indexOf('about.html') >= 0 && !$('main .hornor .txt .html.hover').length))){
                   if(e.detail > 0){
                      //console.log("下");  
                      scrollDown = true;
                      if(scrollOld == canScroll || $('.mobileDevice').length) return false;
                      if(scrlTimes != Math.ceil(scrlTimes)){
                          scrlTimes = Math.floor(scrlTimes);
                      }
                      scrlTimes++;
                   }else{
                      //console.log("上");  
                      scrollDown = false;
                      if(!scrlTimes || $('.mobileDevice').length) return false;
                      if(scrlTimes != Math.ceil(scrlTimes)){
                          scrlTimes = Math.ceil(scrlTimes);
                      }
                      scrlTimes--;
                   }
                   custmzScroll();
                }
             })
    
             window.addEventListener('mousewheel', function (e) {
                if(!$('.mobileDevice').length && (window.location.href.indexOf('about.html') < 0 || (window.location.href.indexOf('about.html') >= 0 && !$('main .hornor .txt .html.hover').length))){
                   if(e.wheelDelta < 0){
                      //console.log("下");  
                      scrollDown = true;
                      if(scrollOld == canScroll || $('.mobileDevice').length) return false;
                      if(scrlTimes != Math.ceil(scrlTimes)){
                          scrlTimes = Math.floor(scrlTimes);
                      }
                      scrlTimes++;
                   }else{
                      //console.log("上");  
                      scrollDown = false;
                      if(!scrlTimes || $('.mobileDevice').length) return false;
                      if(scrlTimes != Math.ceil(scrlTimes)){
                          scrlTimes = Math.ceil(scrlTimes);
                      }
                      scrlTimes--;
                   }
                   custmzScroll();
                }
             })
           
            function custmzScroll(){
                canScroll = parseInt(bodyH - window.innerHeight);
                scrlTimes = scrollNew / 100;
                if(scrollDown){
                    if(jumpPoint){
                        scrollNew = jumpPoint;
                        jumpPoint = 0;
                    }else{
                        scrollNew += 100;
                    }
                    scrollNew > canScroll && (scrollNew = canScroll);
                }else{
                    scrollNew -= 100;
                    scrollNew < 0 && (scrollNew = 0);
                }
                
                scrollStart = true;
            }

            function updateScroll(val){
                document.documentElement.scrollTop = document.body.scrollTop = val;
                clearTimeout(barOpacity);
                $('.scroll').addClass('active');
                barOpacity = setTimeout(function(){
                    $('.scroll').removeClass('active');
                },500)
                
            }
            function prepareSide(cls){
                setTimeout(function(){
                    var el = 'main ' + cls + ' .side';
                    console.log(el);
                    var t = $(el).text().split('');
                    $(el).find('span').text('');
                    for(var n = 0;n < t.length;n++){
                        var i = $('<i></i>').text(t[t.length - n - 1]);
                        i.css('transition-delay',50 * n + 'ms');
                        $(el).find('span').prepend(i);
                    }
                    $(el).height(window.innerHeight);
                },10)
                
                watchSide = setInterval(function(){
                    if(beginningDelay != null && beginningDelay < animateDelayCount) return false;
                    for(var aps = 0;aps < $('.side').length;aps++){
                        var tp = $('.side').eq(aps).parent()[0].getBoundingClientRect().top;
                        var fH = $('.side').eq(aps).parent()[0].offsetHeight;
                        if(tp <= 0  && fH + tp >= window.innerHeight){
                            var tpVal = Math.abs(tp);
                            $('.side').eq(aps).css('top',tpVal + 'px');
                        }
                    }
                },10)
            }

            watchScrollTop = setInterval(function(){
                bodyH = $('#contn')[0].offsetHeight;
                if(canScroll != parseInt(bodyH - window.innerHeight)){
                    canScroll = parseInt(bodyH - window.innerHeight);
                }
                var scrollTop = document.documentElement.scrollTop || document.body.scrollTop
                var percent = scrollTop / canScroll;

                
                if($('main .heading .down').length){
                    if(scrollTop >= 100){
                        $('main .heading .down').addClass('hidden');
                    }else{
                        $('main .heading .down').removeClass('hidden');
                    }
                    scrlTimes = scrollTop / 100;
                    /*
                    if(scrollTop > window.innerHeight){
                        $('main .fixedBg .inner').css('top',(window.innerHeight - scrollTop) + 'px');
                    }else{
                        $('main .fixedBg .inner').css('top','0px');
                    }
                    */

                    
                    
                }

                if(!$('.mobileDevice').length){
                    if(scrollTop >= 100){
                        $('header').addClass('add');
                        if(scrlTimes > 1 && scrollDown){
                            $('header').addClass('moveOut');
                        }else if(scrlTimes > 1 && !scrollDown){
                            $('header').removeClass('moveOut');
                        }
                    }else{
                        $('header').removeClass('add');
                        $('header').removeClass('moveOut');
                    }
                    var barCanRoll = window.innerHeight - $('.scroll .bar').height();
                    var topVal = percent * barCanRoll;
                    $('.scroll .bar')[0].topVal = topVal;
                    $('.scroll .bar')[0].style.transform = 'translateY(' + topVal + 'px)';
                    $('.scroll').attr('data-rcdTop',scrollTop);

                    if(scrollStart){
                        for(var s = 0;s < $('.ccjs').length;s++){
                            var dadLft = $('.ccjs').eq(s).parents('.dad')[0].getBoundingClientRect().left;
                            var dadTp = $('.ccjs').eq(s).parents('.dad')[0].getBoundingClientRect().top;
                            var dadW = $('.ccjs').eq(s).parents('.dad')[0].offsetWidth / 2;
                            var dadH = $('.ccjs').eq(s).parents('.dad')[0].offsetHeight / 2;
                            var lft = glbX - dadLft - dadW;
                            var tp = glbY - dadTp -  dadH;
                            /*
                            $('.ccjs')[s].style.transform = 'translate(' + lft + 'px,' + tp + 'px) ' + 'scale(' + (1.15 + speed) + ')';
                            */
                            $('.ccjs')[s].style.marginLeft = lft + 'px';
                            $('.ccjs')[s].style.marginTop = tp + 'px';
                        }
                    }
                }else{
                    scrollNew = scrollTop;
                    if(scrollTop >= 100){
                        $('header').addClass('add');
                    }else{
                        $('header').removeClass('add');
                        $('header').removeClass('moveOut');
                    }

                    if(scrollTop > 100 && scrollNew > scrollOld){
                        $('header').addClass('moveOut');
                    }else if(scrollTop < 100 || scrollTop > 100 && scrollNew < scrollOld){
                        $('header').removeClass('moveOut');
                    }
                    scrollOld = scrollTop;
                }
                
            },10)

            scrollIntvl = setInterval(function(){
                if(!scrollStart) return false;
                if(scrollNew > scrollOld){
                    scrollOld += Math.ceil((scrollNew - scrollOld) / scrollStep);
                }else{
                    scrollOld -= Math.ceil((scrollOld - scrollNew) / scrollStep);
                }
                updateScroll(scrollOld);
                
                if(scrollNew == scrollOld){
                    scrollStart = false;
                    $('header.flip .menu .products .classify').removeClass('noDelay');
                }
            },10)

            var globalMoving = false;
            var glbX,glbY;
            var speed = glbXbf = glbYbf = 0;
            var scaleRcvrDly = null;
            var scaleDly = null;
            function moveFunc(me){
                var mEvent = me|| window.event;
                speed = ((Math.abs(mEvent.clientX - glbXbf) + Math.abs(mEvent.clientY - glbYbf)) / 24);
                if(speed + 1.15 >= 2.4){
                    speed = 1.25;
                }
                glbX = mEvent.clientX;
                glbXbf = mEvent.clientX;
                glbY = mEvent.clientY;
                glbYbf = mEvent.clientY;
                //console.log('x:',mEvent.clientX,',y:',mEvent.clientY);
                for(var s = 0;s < $('.ccjs').length;s++){
                    var dadLft = $('.ccjs').eq(s).parents('.dad')[0].getBoundingClientRect().left;
                    var dadTp = $('.ccjs').eq(s).parents('.dad')[0].getBoundingClientRect().top;
                    var dadW = $('.ccjs').eq(s).parents('.dad')[0].offsetWidth / 2;
                    var dadH = $('.ccjs').eq(s).parents('.dad')[0].offsetHeight / 2;
                    var lft = glbX - dadLft - dadW;
                    var tp = glbY - dadTp -  dadH;

                    $('.ccjs')[s].style.marginLeft = lft + 'px';
                    $('.ccjs')[s].style.marginTop = tp + 'px';
                }
                if(!scaleDly){    
                    scaleDly = setTimeout(function(){
                        $('span.ccjs').css('transform','scale(' + (1.15 + speed) + ')');
                        clearTimeout(scaleDly);
                        scaleDly = null;
                        clearTimeout(scaleRcvrDly);
                        scaleRcvrDly = null;
                        scaleRcvrDly = setTimeout(function(){
                            $('span.ccjs').css('transform','scale(1.15)');
                        },600)
                    },300)
                    
                }
                
             }
             $('body').mousemove(moveFunc);
             var hdlCircle = null;
             var mcPrevent = true;
             
            $(document).ready(function(){
                    browserRedirect(); 
                    if($('.mobileDevice').length && (window.location.href.indexOf('.html') < 0 || window.location.href.indexOf('index') >= 0 || window.location.href.indexOf('about') >= 0)){
                        $('main video').remove();
                    }

                    setTimeout(function(){
                        scrollOld = scrollNew = document.documentElement.scrollTop = document.body.scrollTop = 0;
                    },10)  

                    setTimeout(function(){
                        scrollOld = scrollNew = document.documentElement.scrollTop = document.body.scrollTop = 0;
                        $('body').removeClass('beginTp');
                    },360)

                    setTimeout(function(){
                        if(window.location.href.indexOf('pointId') >= 0){
                            var id = GetQueryString('pointId');
                            scrollOld = scrollNew = document.documentElement.scrollTop = document.body.scrollTop = parseInt($('#' + id)[0].getBoundingClientRect().top);
                            scrlTimes = Math.floor(scrollNew / 100);
                        }
                    },510)
                    

                    ctctLft = setInterval(function(){
                        if(mcPrevent) return false;
                        var lft = $('.mcjs.enter i')[0].lft;
                        var newVal = Math.abs(currLft - lft);
                        newVal = Math.ceil(newVal / 10);
                        if(currLft > lft){
                            lft += newVal;
                        }else{
                            lft -= newVal;
                        }
                        $('.mcjs.enter i')[0].lft = lft;
                        $('.mcjs.enter i').css('margin-left',lft + 'px');
                        $('.mcjs.enter span').css('margin-left',lft * .14 + 'px');
                        if(lft == currLft && !Number($('.mcjs.enter').attr('canmove'))){
                            mcPrevent = true;
                            $('.mcjs.enter').removeClass('enter');
                        }
                    },10)

                    function updateLft(val){
                        currLft = val;
                        if(!val) return false;
                        mcPrevent = false;
                        if(!$('.mcjs.enter i')[0].lft){
                            $('.mcjs.enter i')[0].lft = 0;
                        }
                        if(val > 0){
                            lftGt = true;
                        }else{
                            lftGt = false;
                        }
                    }
        

                    $('.mcjs').click(function(){
                        //window.location.href = 'contact.html';
                    })
                    $('.mcjs').mouseenter(function(eve){
                        $(this).attr('canmove',1);
                        $(this).addClass('enter');
                        var x = eve.clientX;
                        var elX = $(this)[0].getBoundingClientRect().left;
                        var lft = x - elX - $(this).width() / 2;
                        updateLft(parseInt(lft));
                        $(this)[0].onmousemove = function(e){
                            if(!Number(this.getAttribute('canmove'))) return false;
                            var x = e.clientX;
                            var elX = this.getBoundingClientRect().left;
                            
                            if(x < elX || x > elX + this.offsetWidth){
                                var lft = 0;
                            }else{
                                var lft = x - elX - this.offsetWidth / 2;
                            }
                            updateLft(parseInt(lft));
                            
                        }
                    }).mouseleave(function(){
                        $('.mcjs.enter i')[0].style.cssText = '';
                        $(this).attr('canmove',0);
                        $(this)[0].onmousemove = null;
                        currLft = 0;
                    })

                    $('.scroll').mouseenter(function(){
                        $(this).addClass('active');
                    }).mouseleave(function(){
                        if($('.scroll .bar').attr('canmove') != 'true'){
                            $(this).removeClass('active');
                        }
                    })

                    $('.scroll .bar').mousedown(function(se){
                        $(this).attr('canmove','true');
                        $('html').removeClass('noDragging');
                        var sEvnt = se.event || window.event;
                        var startY = sEvnt.clientY;
                        var This = $(this);
                        var eleY = This[0].topVal;
                        $(document).mousemove(function(eve){
                            if(This.attr('canmove') != 'true') return false;
                            var oe = eve.event || window.event;
                            var mouseY = oe.clientY;
                            var topVal = eleY + (mouseY - startY);
                            var eleH = This[0].offsetHeight;
                            var barCanRoll = window.innerHeight - eleH;
                            var percent = topVal / barCanRoll;
                            if(percent < 0){
                                percent = 0;
                            }else if(percent > 1){
                                percent = 1;
                            }
                            var val = parseInt(percent * canScroll);
                            updateScroll(val);
                            scrollNew = scrollOld = val;
                            window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
                        })
                    })

                    if(!$('.mobileDevice').length){
                        $(document).mouseup(function(be){
                            var bEvnt = be.event || window.event;
                            $('.scroll .bar').attr('canmove','false');
                            //window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
                            if(bEvnt.clientX < window.innerWidth - 8){
                                $('.scroll').removeClass('active');
                            }
                        })
                    }
                    

                    $('.scroll').mouseup(function(te){
                        var tEvnt = te.event || window.event;
                        var topVal = tEvnt.clientY - $(this).find('.bar').height() / 2;
                        var barCanRoll = window.innerHeight - $(this).find('.bar').height();
                        if(topVal < 0){
                            topVal = 0;
                        }else if(topVal > barCanRoll){
                            topVal = barCanRoll;
                        }
                        var percent = topVal / barCanRoll;
                        var val = parseInt(percent * canScroll);
                        scrlTimes = val / 100;
                        scrollStart = true;
                        scrollNew = val;
                        //console.log(val);
                    })

                    $('.dad').mousemove(function(){
                         //获取bigimage此时的src的值
                         var src = $(this).find('mouse').attr("src");
                         //更改放大镜的src的值，切换图片
                         $("[mirror]").attr("src",src);
                    })

                    $('header .menuBtn').click(function(){
                        if($(this).parents('.flip').length){
                            $('header').removeClass('flip');
                        }else{
                            $('header').addClass('flip');
                        }
                    })
            })
            